/*    */ package com.zimbra.cs.service.admin;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.AdminConstants;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.cs.account.Cos;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.accesscontrol.AdminRight;
/*    */ import com.zimbra.cs.account.accesscontrol.Rights.Admin;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class GetAllCos
/*    */   extends AdminDocumentHandler
/*    */ {
/*    */   public static final String BY_NAME = "name";
/*    */   public static final String BY_ID = "id";
/*    */   
/*    */   public boolean domainAuthSufficient(Map context)
/*    */   {
/* 45 */     return true;
/*    */   }
/*    */   
/*    */   public Element handle(Element request, Map<String, Object> context) throws ServiceException
/*    */   {
/* 50 */     ZimbraSoapContext zsc = getZimbraSoapContext(context);
/* 51 */     Provisioning prov = Provisioning.getInstance();
/* 52 */     List<Cos> coses = prov.getAllCos();
/*    */     
/* 54 */     AdminAccessControl aac = AdminAccessControl.getAdminAccessControl(zsc);
/*    */     
/* 56 */     Element response = zsc.createElement(AdminConstants.GET_ALL_COS_RESPONSE);
/* 57 */     for (Cos cos : coses) {
/* 58 */       if (aac.hasRightsToList(cos, Rights.Admin.R_listCos, null))
/* 59 */         GetCos.encodeCos(response, cos, null, aac.getAttrRightChecker(cos));
/*    */     }
/* 61 */     return response;
/*    */   }
/*    */   
/*    */   public void docRights(List<AdminRight> relatedRights, List<String> notes)
/*    */   {
/* 66 */     relatedRights.add(Rights.Admin.R_listCos);
/* 67 */     relatedRights.add(Rights.Admin.R_getCos);
/*    */     
/* 69 */     notes.add("If the authenticated admin does not have the corresponding list{Entry} right for an entry, the entry is skipped in the getAllXXX/searchXXX/searchDirectoryResponse,  no PERM_DENIED exception will be thrown. Attributes that are not allowed to be get by the authenticated admin will be returned as <a n=\"{attr-name}\" pd=\"1\"/>.");
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/admin/GetAllCos.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */